package com.svn.ui.control;

import java.awt.event.ActionEvent;

import javax.swing.JComponent;
import javax.swing.JTextPane;
import javax.swing.text.JTextComponent;

import conf.MenuActionCommandEnum;

public class EditMenuAction implements BasAction {

	private JTextComponent text;

	@Override
	public void actionPerformed(ActionEvent arg0) {
		switch (MenuActionCommandEnum.valueOf(arg0.getActionCommand())) {
		case COPYITEM:
			text.copy();
			break;
		case CUTITEM:
			text.cut();
			break;
		case PASTEITEM:
			text.paste();
			break;
		default:
			break;
		}
	}

	@Override
	public void setComponent(JComponent component) {
		this.text = (JTextComponent) component;
	}

}
